<template>
  <div class="shop">
    <head_top title_head="-- 购物车 --"></head_top>
    <div class="info-wrap">
      <div class="info">
        <div style="display: flex" class="info-detail">
          <div class="detail-icon">
            <img class="img-responsive" src="../../image/head_02.png" alt="">
          </div>
          <div class="detail-address">
            <span>华联超市</span>
            <span>配送至: 智慧山北塔B座</span>
            <span>结算金额：<span style="color: red">{{getPrice}} 元</span></span>
          </div>
        </div>
      </div>
      <ul>
         <li style="display: block;width: 100%;margin: 0;border-bottom: 1px solid #eeeeee" v-for="(info,index) in getInfo">
            <div class="goods_detail">
              <span>商品：<span>{{info.title}}</span></span>
              <span>数量 × <span>{{info.num}}</span></span>
              <span>价格: <span>{{info.toallPrice}} 元</span></span>
            </div>
         </li>
      </ul>
      <div class="pay" @click="payFor">支付</div>
    </div>

    <div class="payWrap" :class="{ 'payShow': sheetVisible }">
      <ul>
        <li>
          <span><img class="img-responsive" src="../../image/wx.png" alt=""></span>
          <span>微信</span>
        </li>
        <li>
          <span><img class="img-responsive" src="../../image/icon_04.png" alt=""></span>
          <span>支付宝</span>
        </li>
        <li>
          <span><img class="img-responsive" src="../../image/fx_pyq.png" alt=""></span>
          <span>网银</span>
        </li>
        <li @click="payFor">取消</li>
      </ul>
    </div>
    <div class="payBack" :class="{ 'payShow': sheetVisible }"></div>
    <transition name="fade" mode="out-in"><router-view class="info-contariner"></router-view></transition>
  </div>
</template>

<script>
  import head_top from '../header'
  import { mapGetters} from 'vuex'
  export default {
    name: 'infomation',
    data () {
      return {
        sheetVisible: false,
      }
    },
    computed: mapGetters([
      'getPrice',
      'getInfo'
    ]),
    components: {
      head_top,
    },
    methods: {
      payFor(){
        this.sheetVisible = !this.sheetVisible;
      }
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .shop {
    margin-top: 50px;
  }
  .info-wrap {
    height: 100%;
    /*margin-top: 50px;*/
  }
  .info-wrap {
    height: 100%;
    /*margin-top: 50px;*/
  }
  .info > div {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
    padding: 6px;
    /*padding: 5px 5px 5px 10px;*/
    box-shadow:2px 2px 2px #eeeeee;
    background: white;
  }
  .detail-icon{
    width: 60px;
    height: 60px;
  }
  .detail-address {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
    padding-left: 10px;
  }

  .goods_detail{
    display: flex;
    padding-left: 10px;
  }
  .goods_detail > span {
    display: inline-block;
    margin: 5px 20px 5px 0;
  }
  .goods_detail > span:nth-child(odd) > span{
    color: orange;
  }
  .goods_detail > span:nth-child(even) > span{
    color: cornflowerblue;
  }
.pay {
  width: 60%;
  height:24px;
  line-height: 24px;
  font-size: 14px;
  margin: 0 auto;
  margin-top: 50px;
  border-radius: 5px;
  background: #2aaa6d;
  color: white;
}
.payWrap {
  position: absolute;
  z-index: 666;
  bottom: -140px;
  width: 100%;
  height: 180px;
  background: rgba(255,255,255,1);
  transition: all .5s;
}
.payWrap ul {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%
}
.payWrap ul > li {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border-bottom: 1px solid #eeeeee;
  /*color: white;*/
  font-family: "微软雅黑";
  font-size: 17px;
}
.payWrap ul > li:last-child{
    border: none;
}
  .payWrap ul > li > span:first-child {
    position: absolute;
    width: 25px;
    height: 25px;
    overflow: hidden;
    left: 50%;
    margin-left: -60px;
  }
  .payWrap ul > li > span:last-child {
    width: 100px;
    height: 25px;
    overflow: hidden;
  }
.payBack {
  display: none;
  position: absolute;
  bottom: 0;
  z-index: 555;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,.6);
}
.payShow {
  bottom: 40px;
  display: block;
}
</style>
